<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/4/24/024
 * Time: 20:37
 */

namespace app\api\model;

use think\facade\Session;

class ClassPlan extends \think\Model
{
    /**
    * 通过class_id获取所有的计划
    */
    public function _getList($mid, $class_id){
        $list = $this->field('id,title')->where([['class_id', '=', $class_id]])->order('sort')->select()->toArray();
        $model = new Course;
        foreach($list as $k=>$v){
            $list[$k]['menus'] = $model->_getListAll($mid, $v['id']);
        }
        return $list;
    }
    
    
}